
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>编译、生成内核镜像 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="part3.html" />
    
    
    <link rel="prev" href="part1.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter0/introduction.html">
            
                <a href="../chapter0/introduction.html">
            
                    
                    第零章：实验环境说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../chapter1/introduction.html">
            
                <a href="../chapter1/introduction.html">
            
                    
                    第一章：独立式可执行程序
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter1/part1.html">
            
                <a href="../chapter1/part1.html">
            
                    
                    [安装 nightly rust]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter1/part2.html">
            
                <a href="../chapter1/part2.html">
            
                    
                    使用包管理器 cargo 创建 rust binary 项目
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter1/part3.html">
            
                <a href="../chapter1/part3.html">
            
                    
                    移除标准库依赖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter1/part4.html">
            
                <a href="../chapter1/part4.html">
            
                    
                    [移除 runtime 依赖]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter1/part5.html">
            
                <a href="../chapter1/part5.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="introduction.html">
            
                <a href="introduction.html">
            
                    
                    第二章：最小化内核
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="part1.html">
            
                <a href="part1.html">
            
                    
                    使用目标三元组描述目标平台
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.2" data-path="part2.html">
            
                <a href="part2.html">
            
                    
                    编译、生成内核镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="part3.html">
            
                <a href="part3.html">
            
                    
                    使用链接脚本指定内存布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="part4.html">
            
                <a href="part4.html">
            
                    
                    [重写程序入口点 -start]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="part5.html">
            
                <a href="part5.html">
            
                    
                    [使用 Qemu 运行内核]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="part6.html">
            
                <a href="part6.html">
            
                    
                    封装 SBI 接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="part7.html">
            
                <a href="part7.html">
            
                    
                    [实现格式化输出]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="part8.html">
            
                <a href="part8.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../chapter3/introduction.html">
            
                <a href="../chapter3/introduction.html">
            
                    
                    第三章：中断
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../chapter3/part1.html">
            
                <a href="../chapter3/part1.html">
            
                    
                    rv64 中断介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../chapter3/part2.html">
            
                <a href="../chapter3/part2.html">
            
                    
                    [手动触发断点中断]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../chapter3/part3.html">
            
                <a href="../chapter3/part3.html">
            
                    
                    程序运行上下文环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../chapter3/part4.html">
            
                <a href="../chapter3/part4.html">
            
                    
                    [实现上下文环境保存与恢复]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../chapter3/part5.html">
            
                <a href="../chapter3/part5.html">
            
                    
                    [时钟中断]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../chapter3/part6.html">
            
                <a href="../chapter3/part6.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../chapter4/introduction.html">
            
                <a href="../chapter4/introduction.html">
            
                    
                    第四章：内存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter4/part1.html">
            
                <a href="../chapter4/part1.html">
            
                    
                    [物理内存探测与管理]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter4/part2.html">
            
                <a href="../chapter4/part2.html">
            
                    
                    [动态内存分配]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter4/part3.html">
            
                <a href="../chapter4/part3.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../chapter5/introduction.html">
            
                <a href="../chapter5/introduction.html">
            
                    
                    第五章：内存虚拟化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../chapter5/part1.html">
            
                <a href="../chapter5/part1.html">
            
                    
                    页表：从虚拟内存到物理内存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../chapter5/part2.html">
            
                <a href="../chapter5/part2.html">
            
                    
                    [内核初始映射]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../chapter5/part3.html">
            
                <a href="../chapter5/part3.html">
            
                    
                    内核重映射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../chapter5/part4.html">
            
                <a href="../chapter5/part4.html">
            
                    
                    内核重映射实现之一：页表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="../chapter5/part5.html">
            
                <a href="../chapter5/part5.html">
            
                    
                    内核重映射实现之二：MemorySet
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="../chapter5/part6.html">
            
                <a href="../chapter5/part6.html">
            
                    
                    [内核重映射实现之三：完结]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="../chapter5/part7.html">
            
                <a href="../chapter5/part7.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter6/introduction.html">
            
                <a href="../chapter6/introduction.html">
            
                    
                    第六章：内核线程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../chapter6/part1.html">
            
                <a href="../chapter6/part1.html">
            
                    
                    线程状态与保存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../chapter6/part2.html">
            
                <a href="../chapter6/part2.html">
            
                    
                    线程切换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../chapter6/part3.html">
            
                <a href="../chapter6/part3.html">
            
                    
                    内核线程初始化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../chapter6/part4.html">
            
                <a href="../chapter6/part4.html">
            
                    
                    [内核线程创建与切换测试]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../chapter6/part5.html">
            
                <a href="../chapter6/part5.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../chapter7/introduction.html">
            
                <a href="../chapter7/introduction.html">
            
                    
                    第七章：线程调度
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../chapter7/part1.html">
            
                <a href="../chapter7/part1.html">
            
                    
                    线程池与线程管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../chapter7/part2.html">
            
                <a href="../chapter7/part2.html">
            
                    
                    内核调度线程 idle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../chapter7/part3.html">
            
                <a href="../chapter7/part3.html">
            
                    
                    线程调度之 Round Robin 算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../chapter7/part4.html">
            
                <a href="../chapter7/part4.html">
            
                    
                    [线程调度测试]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../chapter7/part5.html">
            
                <a href="../chapter7/part5.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../chapter8/introduction.html">
            
                <a href="../chapter8/introduction.html">
            
                    
                    第八章：进程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../chapter8/part1.html">
            
                <a href="../chapter8/part1.html">
            
                    
                    [编写用户程序]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../chapter8/part1_1.html">
            
                <a href="../chapter8/part1_1.html">
            
                    
                    合并内核与应用程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../chapter8/part2.html">
            
                <a href="../chapter8/part2.html">
            
                    
                    在内核中实现系统调用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../chapter8/part3.html">
            
                <a href="../chapter8/part3.html">
            
                    
                    创建虚拟内存空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../chapter8/part4.html">
            
                <a href="../chapter8/part4.html">
            
                    
                    [创建进程]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../chapter8/part5.html">
            
                <a href="../chapter8/part5.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../chapter9/introduction.html">
            
                <a href="../chapter9/introduction.html">
            
                    
                    第九章：文件系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../chapter9/part1.html">
            
                <a href="../chapter9/part1.html">
            
                    
                    [使用文件系统]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../chapter9/part2.html">
            
                <a href="../chapter9/part2.html">
            
                    
                    [实现记事本]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../chapter9/part3.html">
            
                <a href="../chapter9/part3.html">
            
                    
                    [实现终端]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../chapter9/part4.html">
            
                <a href="../chapter9/part4.html">
            
                    
                    [文件读写]
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../chapter9/part5.html">
            
                <a href="../chapter9/part5.html">
            
                    
                    总结与展望
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../chapter10/introduction.html">
            
                <a href="../chapter10/introduction.html">
            
                    
                    第十章：同步互斥
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../exercise/introduction.html">
            
                <a href="../exercise/introduction.html">
            
                    
                    练习题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../exercise/part1.html">
            
                <a href="../exercise/part1.html">
            
                    
                    1. 中断异常
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../exercise/part2.html">
            
                <a href="../exercise/part2.html">
            
                    
                    2. 物理内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../exercise/part3.html">
            
                <a href="../exercise/part3.html">
            
                    
                    3. 虚拟内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../exercise/part4.html">
            
                <a href="../exercise/part4.html">
            
                    
                    4. 线程管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="../exercise/part5.html">
            
                <a href="../exercise/part5.html">
            
                    
                    5. 用户进程（+ 虚拟内存管理 + 线程管理）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="../exercise/part6.html">
            
                <a href="../exercise/part6.html">
            
                    
                    6. CPU 调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="../exercise/part7.html">
            
                <a href="../exercise/part7.html">
            
                    
                    7. 同步互斥
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="../exercise/part8.html">
            
                <a href="../exercise/part8.html">
            
                    
                    8. 文件系统
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../appendix/introduction.html">
            
                <a href="../appendix/introduction.html">
            
                    
                    附录
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../appendix/inline_asm.html">
            
                <a href="../appendix/inline_asm.html">
            
                    
                    内联汇编
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../appendix/install_rust.html">
            
                <a href="../appendix/install_rust.html">
            
                    
                    安装 rust
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >编译、生成内核镜像</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x7F16;&#x8BD1;&#x3001;&#x751F;&#x6210;&#x5185;&#x6838;&#x955C;&#x50CF;">&#x7F16;&#x8BD1;&#x3001;&#x751F;&#x6210;&#x5185;&#x6838;&#x955C;&#x50CF;</h2>
<ul>
<li><a href="https://github.com/rcore-os/rCore_tutorial/tree/ch2-pa4" target="_blank">&#x4EE3;&#x7801;</a></li>
</ul>
<h3 id="&#x4F7F;&#x7528;-riscv64-&#x76EE;&#x6807;&#x7F16;&#x8BD1;&#x9879;&#x76EE;">&#x4F7F;&#x7528; riscv64 &#x76EE;&#x6807;&#x7F16;&#x8BD1;&#x9879;&#x76EE;</h3>
<p>&#x73B0;&#x5728;&#x6211;&#x4EEC;&#x5C1D;&#x8BD5;&#x7528; riscv64 &#x7684;&#x76EE;&#x6807;&#x6765;&#x7F16;&#x8BD1;&#x8FD9;&#x4E2A;&#x9879;&#x76EE;&#xFF1A;</p>
<pre class="language-"><code class="lang-sh">$ cargo build --target riscv64imac-unknown-none-elf
</code></pre>
<p>&#x7ED3;&#x679C;&#x51FA;&#x73B0;&#x4E86;&#x4EE5;&#x4E0B;&#x9519;&#x8BEF;&#xFF1A;</p>
<pre class="language-"><code class="lang-sh">error<span class="token punctuation">[</span>E0463<span class="token punctuation">]</span>: can&apos;t <span class="token function">find</span> crate <span class="token keyword">for</span> <span class="token variable"><span class="token variable">`</span>core<span class="token variable">`</span></span>
  <span class="token operator">|</span>
  <span class="token operator">=</span> note: the <span class="token variable"><span class="token variable">`</span>riscv64imac-unknown-none-elf<span class="token variable">`</span></span> target may not be installed
</code></pre>
<p>&#x539F;&#x56E0;&#x662F; Rust &#x5DE5;&#x5177;&#x94FE;&#x9ED8;&#x8BA4;&#x6CA1;&#x6709;&#x5185;&#x7F6E;&#x6838;&#x5FC3;&#x5E93; core &#x5728;&#x8FD9;&#x4E2A;&#x76EE;&#x6807;&#x4E0B;&#x7684;&#x9884;&#x7F16;&#x8BD1;&#x7248;&#x672C;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x624B;&#x52A8;&#x5B89;&#x88C5;&#x5B83;&#xFF1A;</p>
<pre class="language-"><code class="lang-sh">$ rustup target <span class="token function">add</span> riscv64imac-unknown-none-elf
</code></pre>
<p>&#x5F88;&#x5FEB;&#x4E0B;&#x8F7D;&#x5B89;&#x88C5;&#x597D;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x91CD;&#x8BD5;&#x4E00;&#x4E0B;&#xFF0C;&#x53D1;&#x73B0;&#x5C31;&#x53EF;&#x4EE5;&#x6210;&#x529F;&#x7F16;&#x8BD1;&#x4E86;&#x3002;</p>
<p>&#x7F16;&#x8BD1;&#x51FA;&#x7684;&#x7ED3;&#x679C;&#x88AB;&#x653E;&#x5728;&#x4E86; <em>target/riscv64imac-unknown-none-elf/debug</em> &#x6587;&#x4EF6;&#x5939;&#x4E2D;&#x3002;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x5176;&#x4E2D;&#x6709;&#x4E00;&#x4E2A;&#x540D;&#x4E3A; <em>os</em> &#x7684;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x3002;&#x4E0D;&#x8FC7;&#x7531;&#x4E8E;&#x5B83;&#x7684;&#x76EE;&#x6807;&#x5E73;&#x53F0;&#x662F; riscv64&#xFF0C;&#x6211;&#x4EEC;&#x6682;&#x65F6;&#x8FD8;&#x4E0D;&#x80FD;&#x6267;&#x884C;&#x5B83;&#x3002;</p>
<h3 id="&#x4E3A;&#x9879;&#x76EE;&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x76EE;&#x6807;&#x4E09;&#x5143;&#x7EC4;">&#x4E3A;&#x9879;&#x76EE;&#x8BBE;&#x7F6E;&#x9ED8;&#x8BA4;&#x76EE;&#x6807;&#x4E09;&#x5143;&#x7EC4;</h3>
<p>&#x7531;&#x4E8E;&#x6211;&#x4EEC;&#x4E4B;&#x540E;&#x90FD;&#x4F1A;&#x4F7F;&#x7528; riscv64 &#x4F5C;&#x4E3A;&#x7F16;&#x8BD1;&#x76EE;&#x6807;&#xFF0C;&#x4E3A;&#x4E86;&#x907F;&#x514D;&#x6BCF;&#x6B21;&#x90FD;&#x8981;&#x52A0; <code>--target</code> &#x53C2;&#x6570;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <a href="https://doc.rust-lang.org/cargo/reference/config.html" target="_blank">Cargo &#x914D;&#x7F6E;&#x6587;&#x4EF6;</a> &#x4E3A;&#x9879;&#x76EE;&#x914D;&#x7F6E;&#x9ED8;&#x8BA4;&#x7684;&#x7F16;&#x8BD1;&#x9009;&#x9879;&#x3002;</p>
<p>&#x5728; <em>os</em> &#x6587;&#x4EF6;&#x5939;&#x4E2D;&#x521B;&#x5EFA;&#x4E00;&#x4E2A; <em>.cargo</em> &#x6587;&#x4EF6;&#x5939;&#xFF0C;&#x5E76;&#x5728;&#x5176;&#x4E2D;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x540D;&#x4E3A; <em>config</em> &#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x5728;&#x5176;&#x4E2D;&#x586B;&#x5165;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#xFF1A;</p>
<pre class="language-"><code class="lang-toml"><span class="token comment"># .cargo/config</span>

<span class="token punctuation">[</span><span class="token table class-name">build</span><span class="token punctuation">]</span>
<span class="token key property">target</span> <span class="token punctuation">=</span> <span class="token string">&quot;riscv64imac-unknown-none-elf&quot;</span>
</code></pre>
<p>&#x8FD9;&#x6307;&#x5B9A;&#x4E86;&#x6B64;&#x9879;&#x76EE;&#x7F16;&#x8BD1;&#x65F6;&#x9ED8;&#x8BA4;&#x7684;&#x76EE;&#x6807;&#x3002;&#x4EE5;&#x540E;&#x6211;&#x4EEC;&#x5C31;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F7F;&#x7528; <code>cargo build</code> &#x6765;&#x7F16;&#x8BD1;&#x4E86;&#x3002;</p>
<h3 id="&#x5B89;&#x88C5;-binutils-&#x5DE5;&#x5177;&#x96C6;">&#x5B89;&#x88C5; binutils &#x5DE5;&#x5177;&#x96C6;</h3>
<p>&#x4E3A;&#x4E86;&#x67E5;&#x770B;&#x548C;&#x5206;&#x6790;&#x751F;&#x6210;&#x7684;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#xFF0C;&#x6211;&#x4EEC;&#x9996;&#x5148;&#x9700;&#x8981;&#x5B89;&#x88C5;&#x4E00;&#x5957;&#x540D;&#x4E3A; binutils &#x7684;&#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#x96C6;&#xFF0C;&#x5176;&#x4E2D;&#x5305;&#x542B;&#x4E86; objdump&#x3001;objcopy &#x7B49;&#x5E38;&#x7528;&#x5DE5;&#x5177;&#x3002;</p>
<p>Rust &#x793E;&#x533A;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A; <a href="https://github.com/rust-embedded/cargo-binutils" target="_blank">cargo-binutils</a> &#x9879;&#x76EE;&#xFF0C;&#x53EF;&#x4EE5;&#x5E2E;&#x52A9;&#x6211;&#x4EEC;&#x65B9;&#x4FBF;&#x5730;&#x8C03;&#x7528; Rust &#x5185;&#x7F6E;&#x7684; LLVM binutils&#x3002;&#x6211;&#x4EEC;&#x7528;&#x4EE5;&#x4E0B;&#x547D;&#x4EE4;&#x5B89;&#x88C5;&#x5B83;&#xFF1A;</p>
<pre class="language-"><code class="lang-sh">$ cargo <span class="token function">install</span> cargo-binutils
$ rustup component <span class="token function">add</span> llvm-tools-preview
</code></pre>
<p>&#x4E4B;&#x540E;&#x5C1D;&#x8BD5;&#x4F7F;&#x7528; <code>rust-objdump</code> &#x770B;&#x770B;&#x662F;&#x5426;&#x5B89;&#x88C5;&#x6210;&#x529F;&#x3002;</p>
<blockquote>
<p><strong>[info] &#x5176;&#x5B83;&#x9009;&#x62E9;&#xFF1A;GNU &#x5DE5;&#x5177;&#x94FE;</strong></p>
<p>&#x9664;&#x4E86;&#x5185;&#x7F6E;&#x7684; LLVM &#x5DE5;&#x5177;&#x94FE;&#x4EE5;&#x5916;&#xFF0C;&#x6211;&#x4EEC;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; GNU &#x5DE5;&#x5177;&#x94FE;&#xFF0C;&#x5176;&#x4E2D;&#x8FD8;&#x5305;&#x542B;&#x4E86; GCC &#x7B49; C &#x8BED;&#x8A00;&#x5DE5;&#x5177;&#x94FE;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x4E0B;&#x8F7D;&#x6700;&#x65B0;&#x7684;&#x9884;&#x7F16;&#x8BD1;&#x7248;&#x672C;&#xFF08;<a href="https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz" target="_blank">Linux</a>/<a href="https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-apple-darwin.tar.gz" target="_blank">Mac</a>&#xFF09;&#x5E76;&#x5B89;&#x88C5;&#xFF0C;&#x5982;&#x679C;&#x8BE5;&#x94FE;&#x63A5;&#x8FC7;&#x671F;&#x7684;&#x8BDD;&#x53EF;&#x4EE5;&#x5728; <a href="https://www.sifive.com/boards#software" target="_blank">&#x8FD9;&#x91CC;</a> &#x81EA;&#x5DF1;&#x627E;&#x3002;</p>
</blockquote>
<h3 id="&#x67E5;&#x770B;&#x751F;&#x6210;&#x7684;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;">&#x67E5;&#x770B;&#x751F;&#x6210;&#x7684;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;</h3>
<p>&#x6211;&#x4EEC;&#x7F16;&#x8BD1;&#x4E4B;&#x540E;&#x7684;&#x4EA7;&#x7269;&#x4E3A; <em>target/riscv64imac-unknown-none-elf/debug/os</em> &#xFF0C;&#x8BA9;&#x6211;&#x4EEC;&#x5148;&#x770B;&#x770B;&#x5B83;&#x7684;&#x6587;&#x4EF6;&#x7C7B;&#x578B;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ <span class="token function">file</span> target/riscv64imac-unknown-none-elf/debug/os
target/riscv64imac-unknown-none-elf/debug/os: ELF <span class="token number">64</span>-bit LSB executable, UCB RISC-V, version <span class="token number">1</span> <span class="token punctuation">(</span>SYSV<span class="token punctuation">)</span>, statically linked, with debug_info, not stripped
</code></pre>
<p>&#x4ECE;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#x5B83;&#x662F;&#x4E00;&#x4E2A; 64 &#x4F4D;&#x7684; <code>elf</code> &#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#xFF0C;&#x67B6;&#x6784;&#x662F; <code>RISC-V</code> &#xFF1B;&#x94FE;&#x63A5;&#x65B9;&#x5F0F;&#x4E3A; <strong>&#x9759;&#x6001;&#x94FE;&#x63A5;</strong> &#xFF1B;<code>not stripped</code> &#x6307;&#x7684;&#x662F;&#x91CC;&#x9762;&#x7B26;&#x53F7;&#x8868;&#x7684;&#x4FE1;&#x606F;&#x672A;&#x88AB;&#x5254;&#x9664;&#xFF0C;&#x800C;&#x8FD9;&#x4E9B;&#x4FE1;&#x606F;&#x5728;&#x8C03;&#x8BD5;&#x7A0B;&#x5E8F;&#x65F6;&#x4F1A;&#x7528;&#x5230;&#xFF0C;&#x7A0B;&#x5E8F;&#x6B63;&#x5E38;&#x6267;&#x884C;&#x65F6;&#x901A;&#x5E38;&#x4E0D;&#x4F1A;&#x4F7F;&#x7528;&#x3002;</p>
<p>&#x63A5;&#x4E0B;&#x6765;&#x4F7F;&#x7528;&#x521A;&#x521A;&#x5B89;&#x88C5;&#x7684;&#x5DE5;&#x5177;&#x94FE;&#x4E2D;&#x7684; <code>rust-objdump</code> &#x5DE5;&#x5177;&#x770B;&#x770B;&#x5B83;&#x7684;&#x5177;&#x4F53;&#x4FE1;&#x606F;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ rust-objdump target/riscv64imac-unknown-none-elf/debug/os -x --arch-name<span class="token operator">=</span>riscv64

target/riscv64imac-unknown-none-elf/debug/os:    <span class="token function">file</span> <span class="token function">format</span> ELF64-riscv

architecture: riscv64
start address: 0x0000000000011000

Sections:
Idx Name          Size     VMA          Type
  <span class="token number">0</span>               00000000 0000000000000000
  <span class="token number">1</span> .text         0000000c 0000000000011000 TEXT
  <span class="token number">2</span> .debug_str    000004f6 0000000000000000
  <span class="token number">3</span> .debug_abbrev 0000010e 0000000000000000
  <span class="token number">4</span> .debug_info   00000633 0000000000000000
  <span class="token number">5</span> .debug_aranges 00000040 0000000000000000
  <span class="token number">6</span> .debug_ranges 00000030 0000000000000000
  <span class="token number">7</span> .debug_macinfo 00000001 0000000000000000
  <span class="token number">8</span> .debug_pubnames 000000ce 0000000000000000
  <span class="token number">9</span> .debug_pubtypes 000003a2 0000000000000000
 <span class="token number">10</span> .debug_frame  00000068 0000000000000000
 <span class="token number">11</span> .debug_line   00000059 0000000000000000
 <span class="token number">12</span> .comment      00000012 0000000000000000
 <span class="token number">13</span> .symtab       00000108 0000000000000000
 <span class="token number">14</span> .shstrtab     000000b4 0000000000000000
 <span class="token number">15</span> .strtab       0000002d 0000000000000000

SYMBOL TABLE:
0000000000000000 l    <span class="token function">df</span> *ABS*    00000000 3k1zkxjipadm3tm5
0000000000000000         .debug_frame    00000000
0000000000011000         .text    00000000
0000000000011000         .text    00000000
0000000000011000         .text    00000000
000000000001100c         .text    00000000
0000000000000000         .debug_ranges    00000000
0000000000000000         .debug_info    00000000
0000000000000000         .debug_line    00000000 .Lline_table_start0
0000000000011000 g     F .text    0000000c _start
Program Header:
    PHDR off    0x0000000000000040 vaddr 0x0000000000010040 paddr 0x0000000000010040 align <span class="token number">2</span>**3
         filesz 0x00000000000000e0 memsz 0x00000000000000e0 flags r--
    LOAD off    0x0000000000000000 vaddr 0x0000000000010000 paddr 0x0000000000010000 align <span class="token number">2</span>**12
         filesz 0x0000000000000120 memsz 0x0000000000000120 flags r--
    LOAD off    0x0000000000001000 vaddr 0x0000000000011000 paddr 0x0000000000011000 align <span class="token number">2</span>**12
         filesz 0x0000000000001000 memsz 0x0000000000001000 flags r-x
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align <span class="token number">2</span>**64
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-

Dynamic Section:
</code></pre>
<p>&#x6211;&#x4EEC;&#x6309;&#x987A;&#x5E8F;&#x9010;&#x4E2A;&#x67E5;&#x770B;&#xFF1A;</p>
<ul>
<li><em>start address</em> &#x662F;&#x7A0B;&#x5E8F;&#x7684;&#x5165;&#x53E3;&#x5730;&#x5740;&#x3002;</li>
<li><em>Sections</em>&#xFF0C;&#x4ECE;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x7A0B;&#x5E8F;&#x5404;&#x6BB5;&#x7684;&#x5404;&#x79CD;&#x4FE1;&#x606F;&#x3002;&#x540E;&#x9762;&#x4EE5; <code>debug</code> &#x5F00;&#x5934;&#x7684;&#x6BB5;&#x662F;&#x8C03;&#x8BD5;&#x4FE1;&#x606F;&#x3002;</li>
<li><em>SYMBOL TABLE</em> &#x5373;&#x7B26;&#x53F7;&#x8868;&#xFF0C;&#x4ECE;&#x4E2D;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x7A0B;&#x5E8F;&#x4E2D;&#x6240;&#x6709;&#x7B26;&#x53F7;&#x7684;&#x5730;&#x5740;&#x3002;&#x4F8B;&#x5982; <code>_start</code> &#x5C31;&#x4F4D;&#x4E8E;&#x5165;&#x53E3;&#x5730;&#x5740;&#x4E0A;&#x3002;</li>
<li><p><em>Program Header</em> &#x662F;&#x7A0B;&#x5E8F;&#x52A0;&#x8F7D;&#x65F6;&#x6240;&#x9700;&#x7684;&#x6BB5;&#x4FE1;&#x606F;&#x3002;</p>
<p>&#x5176;&#x4E2D; <code>off</code> &#x662F;&#x5B83;&#x5728;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x4F4D;&#x7F6E;&#xFF0C;<code>vaddr</code> &#x548C; <code>paddr</code> &#x662F;&#x8981;&#x52A0;&#x8F7D;&#x5230;&#x7684;&#x865A;&#x62DF;&#x5730;&#x5740;&#x548C;&#x7269;&#x7406;&#x5730;&#x5740;&#xFF0C;<code>align</code> &#x89C4;&#x5B9A;&#x4E86;&#x5730;&#x5740;&#x7684;&#x5BF9;&#x9F50;&#xFF0C;<code>filesz</code> &#x548C; <code>memsz</code> &#x5206;&#x522B;&#x8868;&#x793A;&#x5B83;&#x5728;&#x6587;&#x4EF6;&#x548C;&#x5185;&#x5B58;&#x4E2D;&#x7684;&#x5927;&#x5C0F;&#xFF0C;<code>flags</code> &#x63CF;&#x8FF0;&#x4E86;&#x76F8;&#x5173;&#x6743;&#x9650;&#xFF08;r&#xFF1A;&#x53EF;&#x8BFB;&#xFF0C;w&#xFF1A;&#x53EF;&#x5199;&#xFF0C;x&#xFF1A;&#x53EF;&#x6267;&#x884C;&#xFF09;</p>
</li>
</ul>
<p>&#x5728;&#x8FD9;&#x91CC;&#x6211;&#x4EEC;&#x4F7F;&#x7528;&#x7684;&#x662F; <code>-x</code> &#x6765;&#x67E5;&#x770B;&#x7A0B;&#x5E8F;&#x7684;&#x5143;&#x4FE1;&#x606F;&#xFF0C;&#x4E0B;&#x9762;&#x6211;&#x4EEC;&#x7528; <code>-d</code> &#x6765;&#x5BF9;&#x4EE3;&#x7801;&#x8FDB;&#x884C;&#x53CD;&#x6C47;&#x7F16;&#xFF1A;</p>
<pre class="language-"><code class="lang-sh">$ rust-objdump target/riscv64imac-unknown-none-elf/debug/os -d --arch-name<span class="token operator">=</span>riscv64

target/riscv64imac-unknown-none-elf/debug/os:    <span class="token function">file</span> <span class="token function">format</span> ELF64-riscv


Disassembly of section .text:

0000000000011000 _start:
   <span class="token number">11000</span>: <span class="token number">41</span> <span class="token number">11</span>                            addi    sp, sp, -16
   <span class="token number">11002</span>: 06 e4                            sd    ra, <span class="token number">8</span><span class="token punctuation">(</span>sp<span class="token punctuation">)</span>
   <span class="token number">11004</span>: <span class="token number">22</span> e0                            sd    s0, <span class="token number">0</span><span class="token punctuation">(</span>sp<span class="token punctuation">)</span>
   <span class="token number">11006</span>: 00 08                            addi    s0, sp, <span class="token number">16</span>
   <span class="token number">11008</span>: 09 a0                            j    <span class="token number">2</span>
   1100a: 01 a0                            j    <span class="token number">0</span>
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x5176;&#x4E2D;&#x53EA;&#x6709;&#x4E00;&#x4E2A; <code>_start</code> &#x51FD;&#x6570;&#xFF0C;&#x91CC;&#x9762;&#x4EC0;&#x4E48;&#x90FD;&#x4E0D;&#x505A;&#xFF0C;&#x5C31;&#x4E00;&#x4E2A;&#x6B7B;&#x5FAA;&#x73AF;&#x3002;</p>
<h3 id="&#x751F;&#x6210;&#x5185;&#x6838;&#x955C;&#x50CF;">&#x751F;&#x6210;&#x5185;&#x6838;&#x955C;&#x50CF;</h3>
<p>&#x6211;&#x4EEC;&#x4E4B;&#x524D;&#x751F;&#x6210;&#x7684; <em>elf</em> &#x683C;&#x5F0F;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x6709;&#x4EE5;&#x4E0B;&#x7279;&#x70B9;&#xFF1A;</p>
<ul>
<li>&#x542B;&#x6709;&#x5197;&#x4F59;&#x7684;&#x8C03;&#x8BD5;&#x4FE1;&#x606F;&#xFF0C;&#x4F7F;&#x5F97;&#x7A0B;&#x5E8F;&#x4F53;&#x79EF;&#x8F83;&#x5927;&#xFF1B;</li>
<li>&#x9700;&#x8981;&#x5BF9; <em>program header</em> &#x90E8;&#x5206;&#x8FDB;&#x884C;&#x624B;&#x52A8;&#x89E3;&#x6790;&#x624D;&#x80FD;&#x77E5;&#x9053;&#x5404;&#x6BB5;&#x7684;&#x4FE1;&#x606F;&#xFF0C;&#x800C;&#x8FD9;&#x9700;&#x8981;&#x6211;&#x4EEC;&#x4E86;&#x89E3; <em>program header</em> &#x7684;&#x4E8C;&#x8FDB;&#x5236;&#x683C;&#x5F0F;&#xFF0C;&#x5E76;&#x4EE5;&#x5B57;&#x8282;&#x4E3A;&#x5355;&#x4F4D;&#x8FDB;&#x884C;&#x89E3;&#x6790;&#x3002;</li>
</ul>
<p>&#x7531;&#x4E8E;&#x6211;&#x4EEC;&#x76EE;&#x524D;&#x6CA1;&#x6709;&#x8C03;&#x8BD5;&#x7684;&#x624B;&#x6BB5;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x8C03;&#x8BD5;&#x4FE1;&#x606F;&#xFF1B;&#x540C;&#x65F6;&#x4E5F;&#x4E0D;&#x4F1A;&#x89E3;&#x6790; <em>elf</em> &#x683C;&#x5F0F;&#x6587;&#x4EF6;&#xFF0C;&#x6240;&#x4EE5;&#x4F7F;&#x7528;&#x5DE5;&#x5177; <code>rust-objcopy</code> &#x4ECE; <code>elf</code> &#x683C;&#x5F0F;&#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x751F;&#x6210;&#x5185;&#x6838;&#x955C;&#x50CF;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ rust-objcopy target/riscv64imac-unknown-none-elf/debug/os --strip-all -O binary target/riscv64imac-unknown-none-elf/debug/kernel.bin
</code></pre>
<p>&#x8FD9;&#x91CC; <code>--strip-all</code> &#x8868;&#x660E;&#x4E22;&#x5F03;&#x6240;&#x6709;&#x7B26;&#x53F7;&#x8868;&#x53CA;&#x8C03;&#x8BD5;&#x4FE1;&#x606F;&#xFF0C;<code>-O binary</code> &#x8868;&#x793A;&#x8F93;&#x51FA;&#x4E3A;&#x4E8C;&#x8FDB;&#x5236;&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x81F3;&#x6B64;&#xFF0C;&#x6211;&#x4EEC;&#x7F16;&#x8BD1;&#x5E76;&#x751F;&#x6210;&#x4E86;&#x5185;&#x6838;&#x955C;&#x50CF; <em>kernel.bin</em> &#x3002;&#x63A5;&#x4E0B;&#x6765;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x4F7F;&#x7528; Qemu &#x6A21;&#x62DF;&#x5668;&#x771F;&#x6B63;&#x5C06;&#x6211;&#x4EEC;&#x7684;&#x5185;&#x6838;&#x955C;&#x50CF;&#x8DD1;&#x8D77;&#x6765;&#x3002;&#x4E0D;&#x8FC7;&#x5728;&#x6B64;&#x4E4B;&#x524D;&#x8FD8;&#x9700;&#x8981;&#x5B8C;&#x6210;&#x4E24;&#x4E2A;&#x5DE5;&#x4F5C;&#xFF1A;<strong>&#x8C03;&#x6574;&#x5185;&#x5B58;&#x5E03;&#x5C40;</strong> &#x548C; <strong>&#x91CD;&#x5199;&#x5165;&#x53E3;&#x51FD;&#x6570;</strong> &#x3002;</p>
<p><div id="page-footer" class="localized-footer"><hr><p><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css"></p>
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
  var gitalk = new Gitalk({
    clientID: "ab871063a9fa7f1da571",
    clientSecret: "4760b384e3e452d2241d859cfa6a7da21a8729ec",
    repo: "rCore_tutorial_doc",
    owner: "rcore-os",
    admin: [
      "chyyuu",
      "xyongcn",
      "wangrunji0408",
      "xy-plus",
      "PanQL",
      "wyfcyx",
      "equation314"
    ],
    id: location.pathname,
    distractionFreeMode: false
  });
  gitalk.render("gitalk-container");
</script>
</div></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="part1.html" class="navigation navigation-prev " aria-label="Previous page: 使用目标三元组描述目标平台">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="part3.html" class="navigation navigation-next " aria-label="Next page: 使用链接脚本指定内存布局">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"编译、生成内核镜像","level":"1.4.2","depth":2,"next":{"title":"使用链接脚本指定内存布局","level":"1.4.3","depth":2,"path":"chapter2/part3.md","ref":"chapter2/part3.md","articles":[]},"previous":{"title":"使用目标三元组描述目标平台","level":"1.4.1","depth":2,"path":"chapter2/part1.md","ref":"chapter2/part1.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["hide-element","chapter-fold","katex","alerts","emphasize","-highlight","prism","localized-footer","mermaid-gb3"],"pluginsConfig":{"chapter-fold":{},"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"emphasize":{},"search":{},"localized-footer":{"filename":"extensions/comment/gitalk.html","hline":"true"},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"hide-element":{"elements":[".gitbook-link"]},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"alerts":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chapter2/part2.md","mtime":"2020-09-09T11:31:56.891Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-09-10T06:57:01.716Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    <script src="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

